from pandas import DataFrame

from datareport.api import ConfigClass
from datareport.api.DataSource import DataSource
from datareport.api.IParagraphAnalysis import IParagraphAnalysis
from datareport.api.annotation.Font import Font
from datareport.api.annotation.ImageStyle import ImageStyle

class BaseParagraph(IParagraphAnalysis):

    def __init__(self):
        self.previous:IParagraphAnalysis=None
        self.next:IParagraphAnalysis=None
        self.text = ''
        """文本"""

        self.fonts:[Font] =[]

        self.image: ImageStyle = None
        """图像"""
        self.tables: [DataFrame]=[]
        self.table: DataFrame = None
        """图表"""

        self.sort: int
        """排序,主要用于docx位置"""
        """方法不太行，一方改动，可能八方都得改,链表形式可能更好"""

        self.key_text: dict[str, Font] = None
        """关键文本"""

        self.section: int = 1
        """页号"""

    def getData(self, result):
        pass

    def plot(self, result, plt):
        pass

    def start(self, conn, year, plt):
        pass

    def getHeight(self):
        pass


    # def __lt__(self, other):
    #     """
    #     用于排序
    #     :param other:
    #     :return:
    #     """
    #     if isinstance(other, BaseParagraph):
    #         return self.sort < other.sort
